(function(){
	var da=document;
	var Class= function(){};
	var initializing=false;
	
	Class.extend=function(obj){
		
		var _super=this.prototype;
		initializing=false;
		var prototype=new this();
		initializing=true;
		var fnTest = /xyz/.test(function() { xyz; }) ? /\b_super\b/ : /.*/;
		for(var pro in obj){
			prototype[pro]=typeof obj[pro] == "function" && typeof _super[pro] =="function" && fnTest.test(obj[pro])? (function(name,fn){
				return function(){
					var tmp=this._super;
					this._super=_super[name];
					var ret=fn.apply(this,arguments);
					this._super=tmp;
					return ret;
				}			
			})(pro,obj[pro]):obj[pro];
		}
		var Class=function(){
			if(initializing&&this.init)
			this.init.apply(this,arguments);
		}
		Class.prototype=prototype;
		Class.constructor=Class;
		Class.extend=arguments.callee;
		return Class;		
	}
	var father=Class.extend({
		init:function(name){
			this.name=name
		},
		getName:function(){
			return this.name;
		}
	});
	var father1=new father("yujintao");
	alert(father1.getName());
	var son=father.extend({
		init:function(name,age){
			this._super(name);
			this.age=age;
		},
		getAge:function(){
			return this.age;
		}
	});
	var son1=new son("ginus",2);
	function father(name){
		this.name=name;
	}
	function son(age){
		this.age=age;
	}
	
	
	var extentd = function(a, b, c) {
        var d,e,g = a[u];
        //***靠，在深度继承呢，
        e = new Function;
        
        e[u] = b[u];
        
        e = a[u] = new e;
        
        for (d in g) 
        	e[d] = g[d];
        
        a[u].constructor = a;
        //***
        a.XA = b[u];
        
        if ("string" == typeof c) 
        	e.Xu = c
    };
    estentd(son,father,"nimei");
    console.log(father);
    console.log(son)
//	function s(	){
//		this.p="asdf";
//		alert(typeof this);
//		alert(this instanceof s);
//	}
	
//	function(a, b, c) {
//		
//        var d,e,g = a.prototype;
//        
//        e = new Function;
//        
//        e.prototype = b.prototype;
//        
//        e = a.prototype = new e;
//        
//        for (d in g){ 
//        	e[d] = g[d];
//        }
//        a.prototype.constructor = a;
//        
//        a.WA = b.prototype;
//        if ("string" == typeof c) 
//        	e.Vu = c
//    };
    
    
    
})()

//(function(){
//	var script=document.createElement("script");
//	script.type="text/javascript";
//	var content=document.createTextNode("(function(alert('hello')){})()");
//	script.appendChild(content);
//	document.body.appendChild(script);
//})()